package geez.widget;

import com.google.gwt.user.client.DOM;
import com.google.gwt.user.client.ui.HTML;

import static geez.widget.Geez.withStyle;

public class GHTML extends HTML implements GWidget {

    public GHTML() {
        super();
    }

    public GHTML(String html) {
        super(html);
    }

    public GHTML(String html, boolean wordWrap) {
        super(html, wordWrap);
    }

    public GHTML id(String id) {
        Geez.withNameAndId(this, id);
        return this;
    }

    public GHTML css(String cssClass, String... optionalClasses) {
        withStyle(this, cssClass, optionalClasses);
        return this;
    }

    public GHTML style(String styleAttribute) {
        DOM.setElementAttribute(getElement(), "style", styleAttribute);
        return this;
    }

    public GHTML html(String html) {
        setHTML(html);
        return this;
    }

    public GHTML hide() {
        setVisible(false);
        return this;
    }

    public GHTML show() {
        setVisible(true);
        return this;
    }
}
